<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>导入索引库</title>
</head>
<body>
<div>
	<a href="javascript:void(0)"  class="easyui-linkbutton" onclick="importAll()">一键导入商品数据到索引库</a>
	<span id="p" class="easyui-progressbar" style="width:400px;"></span>
</div>
<script type="text/javascript">
// 通过ajax 发送请求
   function importAll(){
	   var value = $('#p').progressbar('getValue');
		if (value < 100){
			value += Math.floor(Math.random() * 1);
			$('#p').progressbar('setValue', value);
			setTimeout(arguments.callee, 200);
		}
	
		$.ajax({
			url:"/index/importAll",
			type:"GET",
			success:function(data){
				//taotaoresult
				if(data.status==200){
					$.messager.alert('提示','导入成功!');
				}else{
					$.messager.alert('提示','导入失败!');
				}
			}
			
		});	   
   }
</script>
</body>
</html>